package com.example.emos.api.baes;


import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

@Data
@Builder(toBuilder = true)
public class QoBase {

    public QoBase() {
    }

    public QoBase(Integer page, Integer length) {
        this.page = page;
        this.length = length;
    }

    @NotNull(message = "page不能为空")
    @Min(value = 1, message = "page不能小于1")
    @Schema(description = "页数")
    @Builder.Default
    protected Integer page = 1;

    @NotNull(message = "length不能为空")
    @Range(min = 10, max = 50, message = "length必须在10~50之间")
    @Schema(description = "每页记录数")
    @Builder.Default
    protected Integer length = 10;

}
